package cn.com.surker.workcon.service.xugong;

import cn.com.surker.base.system.dao.SysStorageLogDao;
import cn.com.surker.base.system.entity.SysLine;
import cn.com.surker.control.entity.ControlExpend;
import cn.com.surker.lab.dao.LabExpendBatchDao;
import cn.com.surker.lab.entity.LabExpend;
import cn.com.surker.lab.entity.LabExpendOther;
import cn.com.surker.lab.vo.LabExpendVoB;
import cn.com.surker.util.StringUtils;
import cn.com.surker.workcon.common.GKJDBCService;
import cn.com.surker.workcon.service.DosageService;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 消耗信息 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2024-09-26
 */
public class DosageServiceImpl extends GKJDBCService implements DosageService {

	@Resource
	private SysStorageLogDao sysStorageLogDao;

	/**
	 * 盘数据
	 */
	@Resource
	private LabExpendBatchDao labExpendBatchDao;

	/**
	 * 根据盘id,查询工控机消耗信息
	 *
	 * @param pieId
	 * @param batchStere
	 * @return
	 */
	public List<LabExpend> findByPieId(Long lineId, Long invoiceId, Long batchId, String prodId, String pieId, Date batTime,
									   Double batchStere, Long formulaId, Double formulaWater, Long levelOptimizeId, Date createDate) {
		if (lineId == null || StringUtils.isBlank(pieId)) {
			return null;
		}
		SysLine line = getLine(lineId);
		if (line == null) {
			return null;
		}
		JdbcTemplate lineJdbcTemp = getLineJdbcTemp(line);

		return null;
	}

	@Override
	public List<ControlExpend> findWorkByPieId(Long lineId, Long batchId, String prodId, String pieId, Date batTime, Date createDate) {
		if (lineId == null || StringUtils.isBlank(pieId)) {
			return null;
		}
		SysLine line = getLine(lineId);
		if (line == null) {
			return null;
		}

		return null;
	}

	@Override
	public List<LabExpendOther> findAll(Long lineId) {
		return null;
	}

	@Override
	public LabExpend queryByDosId(Long lineId, Long batchId, String dosId) {
		if (lineId == null || StringUtils.isBlank(dosId)) {
			return null;
		}
		SysLine line = getLine(lineId);
		if (line == null) {
			return null;
		}
		JdbcTemplate lineJdbcTemp = getLineJdbcTemp(line);
		if (lineJdbcTemp == null) {
			return null;
		}
		return null;
	}

	@Override
	public List<Long> writeBackB(Long lineId, List<LabExpendVoB> labExpends) {
		return null;
	}

}
